package com.itheima.d1_exception;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.Date;

/**
 * 目标：掌握异常的甩锅处理方式throws
 */
public class ExceptionTest2 {
    public static void main(String[] args) throws ParseException {
        exception("1122");
    }

    public static void exception(String date) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date parse = sdf.parse(date);
        System.out.println(parse);
    }
}
